package cn.com.sixboy.service.common.impl;

import cn.com.sixboy.dao.DataType;
import cn.com.sixboy.dao.QueryConditionEntity;
import cn.com.sixboy.entity.Student;
import cn.com.sixboy.service.base.BaseServiceImplement;
import cn.com.sixboy.service.common.IndexService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * @author Sam.Zheng <zcl1866@sina.com>
 * @date 2013-5-1 19:02:46
 * @version <v0.1>
 * @copyright SixBoy
 */
@Service
public class IndexServiceImpl extends BaseServiceImplement implements
		IndexService {

	@Override
	public boolean addStudent(Student stu) {
		return super.add(stu);
	}

	@Override
	public List findAllStudent() {
		return super.queryAllEntity("findAllStudents", true);
	}

	@Override
	public List findAllStudentByName(String name) {
		QueryConditionEntity cond = new QueryConditionEntity(
				"findAllStudentsByName", "name", DataType.String, "%"+name+"%"); //模糊匹配中间匹配查询
		return super.queryEntities(cond, true);
	}
        
    @Override
        public List findAllClassByName(String name){
            		QueryConditionEntity cond = new QueryConditionEntity(
				"findAllClassesByName", "className", DataType.String, "%"+name+"%"); //模糊匹配中间匹配查询
		return super.queryEntities(cond, true);
        }
        

}
